package com.aliwo.design.patterns.status.ext2;

/**
 * @author xuyayuan
 * @description TODO
 * @date 2021/9/18 16:08
 */
public class Person {
    private int hour;

    private Status status;

    public void doSomething() {
        if (hour == 7) {
            status = new MStatus();
            status.doSomething();
        } else if (hour == 12) {
            status = new LStatus();
            status.doSomething();
        } else if (hour == 18) {
            status = new SState();
            status.doSomething();
        } else {
            status = new NoStatus();
            status.doSomething();
        }
    }

    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }

}
